Skip to content

Conversation

@lsm5
Copy link
Member

@lsm5 lsm5 commented Oct 24, 2025

Following up on review comments in #387 . Reattempting with finer commits for easier review.

@github-actions github-actions bot added the common Related to "common" package label Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
@podmanbot
Copy link

✅ A new PR has been created in buildah to vendor these changes: containers/buildah#6449

@lsm5 lsm5 changed the title common: remove cgv1 (reattempt with finer commits) [WIP] common: remove cgv1 (reattempt with finer commits) Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
@lsm5 lsm5 force-pushed the podman6-no-cgv1-new branch from e82ef0f to c69aaf4 Compare October 24, 2025 19:22
@packit-as-a-service
Copy link

Packit jobs failed. @containers/packit-build please check.

podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
@lsm5 lsm5 force-pushed the podman6-no-cgv1-new branch from 1c21882 to 453e6e8 Compare October 24, 2025 21:43
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
@lsm5 lsm5 force-pushed the podman6-no-cgv1-new branch from 9002044 to 7cf077c Compare October 24, 2025 22:34
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
@lsm5 lsm5 force-pushed the podman6-no-cgv1-new branch from 7cf077c to c30076c Compare October 24, 2025 23:00
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 24, 2025
@lsm5
Copy link
Member Author

lsm5 commented Oct 24, 2025

@Luap99 @mtrmac PTAL. Smaller commits so should be hopefully easier to review.

I haven't removed any of the IsCgroup2UnifiedMode calls where there were error checks. Only assumed the bool to be true there, and removed the cgv1 parts.

Unless there are any critical blockers like some change being obviously wrong or some cgv1 logic still present and open to being called, I'd prefer to leave any cleanups / simplifications for followup.

@lsm5 lsm5 marked this pull request as ready for review October 24, 2025 23:25
@lsm5
Copy link
Member Author

lsm5 commented Oct 24, 2025

should obsolete #387

@lsm5 lsm5 changed the title [WIP] common: remove cgv1 (reattempt with finer commits) common: remove cgv1 (reattempt with finer commits) Oct 25, 2025
lsm5 added 2 commits October 25, 2025 09:27
Replace with cgroups.IsCgroup2UnifiedMode.

Signed-off-by: Lokesh Mandvekar <[email protected]>
And all the cgroup v1 logic that relied on the cgroup2 bool

Signed-off-by: Lokesh Mandvekar <[email protected]>
lsm5 added 9 commits October 25, 2025 09:27
- exclude param from getAvailableControllers
- cgroupV1GetAllSubsystems
- CgroupControl.createGroupDirectory
- readAcct
- readAcctList

Signed-off-by: Lokesh Mandvekar <[email protected]>
Also inline some struct element values with constant values

Signed-off-by: Lokesh Mandvekar <[email protected]>
I can only see it being called in libpod/oci_conmon_linux.go that too
when CgroupManager is not systemd, so it should be safe to remove.

Signed-off-by: Lokesh Mandvekar <[email protected]>
@lsm5 lsm5 force-pushed the podman6-no-cgv1-new branch from df3ce3a to 26e4421 Compare October 25, 2025 13:30
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 25, 2025
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Oct 25, 2025
@lsm5 lsm5 changed the title common: remove cgv1 (reattempt with finer commits) common: remove cgv1 for podman6 (reattempt with finer commits) Oct 25, 2025
@lsm5 lsm5 changed the title common: remove cgv1 for podman6 (reattempt with finer commits) common: remove cgv1 for podman6 Oct 25, 2025
@lsm5
Copy link
Member Author

lsm5 commented Oct 28, 2025

@mheon PTAL.

@mheon
Copy link
Member

mheon commented Oct 29, 2025

LGTM

Copy link
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is really much easier to review when split.

(Reviewed only locally reading the code, I don’t know much about cgroups. Leaving follow-ups for a separate PR as requested.)

}
return subsystems, nil
// AvailableControllers get string:bool map of all the available controllers.
func AvailableControllers(exclude map[string]controllerHandler) ([]string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In “Remove unused parameters and functions post CgroupControl cleanup”: Drop the unused exclude parameter as well?


(And, separately, getAvailableControllers could be inlined into this only caller.)

}
if res.MemorySwap != 0 {
switch {
case res.Memory == -1 || res.MemorySwap == -1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Turning this into if would be nicer.)

@mtrmac mtrmac merged commit b636c80 into containers:main Oct 30, 2025
18 checks passed
@lsm5 lsm5 deleted the podman6-no-cgv1-new branch October 31, 2025 13:51
"strings"

"github.com/opencontainers/cgroups"
"github.com/opencontainers/cgroups/fs"
Copy link
Contributor

@mtrmac mtrmac Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lsm5 in all of these handler packages, we import cgroups/fs to declare fields which are never used, so it looks like this can be simplified further.

… and that makes #387 (comment) even more attractive.

}

type controllerHandler interface {
Create(*CgroupControl) (bool, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️

@lsm5 linuxCpusetHandler.Create still exists — what should happen there? Either it is all obsolete and the code should be removed, or it is still relevant and the .Create method (and .Destroy?) need to be reinstated.

lsm5 added a commit to lsm5/container-libs that referenced this pull request Nov 4, 2025
lsm5 added a commit to lsm5/container-libs that referenced this pull request Nov 4, 2025
lsm5 added a commit to lsm5/container-libs that referenced this pull request Nov 5, 2025
This broke a lot of stuff, so this should only be re-reverted once
things are known to work in Podman and Buildah.

Commits reverted:

- e94388d
- 26e4421
- b7be55c
- cce5ec8
- 5f98dfb
- ceaec36
- ed47881
- 2cf45c5
- 80309d7
- 8251431
- ff00d90
- 213e7ec

Ref: containers#417

Signed-off-by: Lokesh Mandvekar <[email protected]>
@lsm5 lsm5 mentioned this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to "common" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants